<?php

/**
 * Customers form base class.
 *
 * @package    tvpv
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseCustomersForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'searchkey'   => new sfWidgetFormInput(),
      'taxid'       => new sfWidgetFormInput(),
      'name'        => new sfWidgetFormInput(),
      'taxcategory' => new sfWidgetFormPropelChoice(array('model' => 'Taxcustcategories', 'add_empty' => true)),
      'card'        => new sfWidgetFormInput(),
      'maxdebt'     => new sfWidgetFormInput(),
      'address'     => new sfWidgetFormInput(),
      'address2'    => new sfWidgetFormInput(),
      'postal'      => new sfWidgetFormInput(),
      'city'        => new sfWidgetFormInput(),
      'region'      => new sfWidgetFormInput(),
      'country'     => new sfWidgetFormInput(),
      'firstname'   => new sfWidgetFormInput(),
      'lastname'    => new sfWidgetFormInput(),
      'email'       => new sfWidgetFormInput(),
      'phone'       => new sfWidgetFormInput(),
      'phone2'      => new sfWidgetFormInput(),
      'fax'         => new sfWidgetFormInput(),
      'notes'       => new sfWidgetFormInput(),
      'visible'     => new sfWidgetFormInput(),
      'curdate'     => new sfWidgetFormDateTime(),
      'curdebt'     => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'Customers', 'column' => 'id', 'required' => false)),
      'searchkey'   => new sfValidatorString(array('max_length' => 255)),
      'taxid'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'name'        => new sfValidatorString(array('max_length' => 255)),
      'taxcategory' => new sfValidatorPropelChoice(array('model' => 'Taxcustcategories', 'column' => 'id', 'required' => false)),
      'card'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'maxdebt'     => new sfValidatorNumber(),
      'address'     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'address2'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'postal'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'city'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'region'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'country'     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'firstname'   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'lastname'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'email'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'phone'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'phone2'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'fax'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'notes'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'visible'     => new sfValidatorString(array('max_length' => 1)),
      'curdate'     => new sfValidatorDateTime(array('required' => false)),
      'curdebt'     => new sfValidatorNumber(array('required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Customers', 'column' => array('searchkey')))
    );

    $this->widgetSchema->setNameFormat('customers[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Customers';
  }


}
